package br.club.beer;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class BarActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_bar);
		
		// Implementacao da timeline do BAR.
		
		final EditText editText_statusBar = (EditText) findViewById(R.id.editText_statusBar);
		final TextView textView_statusBar = (TextView) findViewById(R.id.textView_statusBar);
		Button button_statusBar = (Button) findViewById(R.id.button_enviar);
		
		// colocando o evento no botao ENVIAR do status do Bar
		button_statusBar.setOnClickListener(new OnClickListener() {
			
			// Implementacao do botao enviar o status para timeline
			@Override
			public void onClick(View view) {
				String statusBar = editText_statusBar.getEditableText().toString();
				textView_statusBar.setText(getString(R.string.TextView_statusBar, statusBar));
				textView_statusBar.setVisibility(view.VISIBLE);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.bar, menu);
		return true;
	}

}
